FROM openjdk:8
MAINTAINER EmoAnaly

# 安装字体支持和中文字体
RUN apt-get update && \
    apt-get install -y fontconfig fonts-wqy-microhei fonts-wqy-zenhei && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# 创建自定义字体目录
RUN mkdir -p /usr/share/fonts/truetype/windows

# 复制Windows字体文件
COPY fonts/simsun.ttc /usr/share/fonts/truetype/windows/
COPY fonts/msyh.ttc /usr/share/fonts/truetype/windows/
COPY fonts/msyhbd.ttc /usr/share/fonts/truetype/windows/

# 设置字体权限并刷新缓存
RUN chmod 644 /usr/share/fonts/truetype/windows/* && \
    fc-cache -fv

ADD target/ea-admin-1.0-SNAPSHOT.jar app.jar
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

ENTRYPOINT ["java","-Xms100m","-Xmx2g", "-Xss10m","-jar","/app.jar", \
"--spring.config.location=/maven/admin/config/application.yml", \
"--logging.path=/maven/admin/logs", \
"--loader.path=/maven/commons/lib"]
